| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

ComboBox.h
1 // ComboBox.h
3 //
5
6 namespace nkWinUi
7 {
11 class ComboBox : public Component
12 {
13 public :
14
18 class Entry final
19 {
20 public :
21
25 Entry () noexcept ;
29 ~Entry () ;
30
31 // Getters
35 nkMemory::StringView getLabel () const ;
39 void* getAttachedData () const ;
40
41 // Setters
47 void setLabel (nkMemory::StringView label) ;
55 void setAttachedData (void* data) ;
56 } ;
57
58 public :
59
67 ComboBox (System* system) noexcept ;
71 ComboBox (const ComboBox&) = delete ;
75 virtual ~ComboBox () ;
76
77 // Getters
81 std::function<void (ComboBox*)> getSelectionCallback () const ;
85 Entry* getEntryPerLabel (nkMemory::StringView label) const ;
92 Entry* getEntryPerData (void* data) const ;
96 virtual Entry* getCurrentSelection () const ;
97
98 // Setters
104 void setSelectionCallback (std::function<void (ComboBox*)> value) ;
110 void setSelectedEntryPerLabel (nkMemory::StringView label) ;
116 void setSelectedEntryPerData (void* data) ;
122 virtual void setSelectedEntry (Entry* selected) ;
123
124 // Entries
134 virtual Entry* insertEntry (nkMemory::StringView label, void* data) ;
141 void setEntryData (nkMemory::StringView label, void* newData) ;
147 virtual void* deleteEntry (nkMemory::StringView label) ;
151 virtual void clearEntries () ;
152
153 // Import / Export
154 virtual void exportIntrospection (nkExport::Node* rootNode) override ;
155 virtual void importClassFromTree (nkExport::Node* rootNode) override ;
156
157 // Operators
161 ComboBox& operator= (const ComboBox&) = delete ;
162
163 public :
164
165 // Statics
173 static nkMemory::UniquePtr<ComboBox> create (System* system = nullptr) ;
174 } ;
175 }
nkWinUi::ComboBox::Entry::Entry
Entry() noexcept
nkWinUi::ComboBox::getSelectionCallback
std::function< void(ComboBox *)> getSelectionCallback() const
nkWinUi::ComboBox::setSelectedEntryPerLabel
void setSelectedEntryPerLabel(nkMemory::StringView label)
nkWinUi::ComboBox::exportIntrospection
virtual void exportIntrospection(nkExport::Node *rootNode) override
nkWinUi::ComboBox::Entry::setLabel
void setLabel(nkMemory::StringView label)
nkWinUi::ComboBox::Entry
Represents an entry within the combo box.
Definition: ComboBox.h:19
nkExport
Encompasses all API of component NilkinsExport.
Definition: Base64Encoder.h:7
nkWinUi::ComboBox::clearEntries
virtual void clearEntries()
nkWinUi::ComboBox::Entry::getAttachedData
void * getAttachedData() const
nkWinUi::Component
Base class for any graphical component.
Definition: Component.h:12
nkWinUi::System
The main system of the component.
Definition: System.h:18
nkWinUi::ComboBox::Entry::getLabel
nkMemory::StringView getLabel() const
nkWinUi::ComboBox::create
static nkMemory::UniquePtr< ComboBox > create(System *system=nullptr)
nkWinUi::ComboBox
A graphical combo box.
Definition: ComboBox.h:12
nkWinUi::ComboBox::getEntryPerData
Entry * getEntryPerData(void *data) const
nkWinUi::ComboBox::insertEntry
virtual Entry * insertEntry(nkMemory::StringView label, void *data)
nkWinUi::ComboBox::importClassFromTree
virtual void importClassFromTree(nkExport::Node *rootNode) override
nkWinUi::ComboBox::setEntryData
void setEntryData(nkMemory::StringView label, void *newData)
nkWinUi::ComboBox::setSelectedEntry
virtual void setSelectedEntry(Entry *selected)
nkWinUi::ComboBox::getEntryPerLabel
Entry * getEntryPerLabel(nkMemory::StringView label) const
nkWinUi::ComboBox::setSelectedEntryPerData
void setSelectedEntryPerData(void *data)
nkWinUi::ComboBox::Entry::setAttachedData
void setAttachedData(void *data)
nkWinUi::ComboBox::setSelectionCallback
void setSelectionCallback(std::function< void(ComboBox *)> value)
nkWinUi
Encompasses all API of component NilkinsWinUi.
Definition: Clipboard.h:7
nkWinUi::ComboBox::deleteEntry
virtual void * deleteEntry(nkMemory::StringView label)
nkWinUi::ComboBox::getCurrentSelection
virtual Entry * getCurrentSelection() const
nkMemory
Encompasses all API of component NilkinsMemory.
Definition: Allocator.h:7